<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>添加课程信息</title>
<%@ include file="../../header.jsp" %>
</head>

<fieldset i="">

<body>

 <form id="formAdd" class="layui-form">
 
 <div class="layui-form-item">
     <label class="layui-form-label">学号</label>
        <div class="layui-input-block">
        <input type= "text" name="studentId" placeholder="请输入学号" class="layui-input" style="width: 150px;"></input>
        </div>
 </div>
 
<div class="layui-form-item">
   <label class ="layui-form-label">姓名</label>
   <div class="layui-input-block">
   <input type="text" name="studentName" placeholder="请输入姓名" class="layui-input" style="width:150px">
   
   </div>
   
</div>
<div class="layui-form-item">
   <label class ="layui-form-label">年龄</label>
   <div class="layui-input-block">
   <input type="text" name="age"  placeholder="请输入年龄" class="layui-input" style="width:150px">
   
   </div>
  </div> 
   
  <div class="layui-form-item">
   <label class ="layui-form-label">性别</label>
   <div class="layui-input-block">
   <input type="text" name="studentSex" placeholder="请输入性别"  class="layui-input" style="width:150px">
   
   </div>
  
</div>

<div class="layui-form-item">
   <label class ="layui-form-label">选课编号</label>
   <div class="layui-input-block">   
   <input type="text" name="courseId"  placeholder="请输入课程编号" class="layui-input" style="width:150px">
   
   </div>
   

</div>

  <div class="layui-form-itme">
   <div class="layui-input-block">
   <input type="button" name ="action" value="添加" lay-submit lay-filter="add" class="layui-btn"></input>
  <input type="javascript:;"  class="layui-btn" onclick="close()" value="关闭" style="width:80px" ></input>
  <button type="reset"  title="重置"  class="layui-btn">重置</button>
   </div>
</div>
 </form>

</body>

</fieldset>
<script src="../../static/js/base.js"></script>
<script type="text/javascript">
element.render();
formSubmit("/StudentMangers/StudentServlet","submit(add)","text",function(data){
		
	if (data == "1") {
								
					layer.msg("添加成功",close)				
				} else if (data == "0") {
					layer.msg("添加失败,该学号已经存在");
				} else {
					layer.msg("添加失败");
				}
	
	
	
			})
			
function close(){
	var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
    parent.layer.close(index);//关闭窗口
}			
</script>
</html>